package cn.zyq.ykb.controller.h5.customer;

import org.springframework.security.access.prepost.PreAuthorize;
import cn.zyq.ykb.system.ry.util.poi.ExcelUtil;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.annotation.Log;
import cn.zyq.ykb.system.ry.enums.BusinessType;
import cn.zyq.ykb.beans.customer.Customer;
import cn.zyq.ykb.service.customer.CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.common.PageParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 客服电话Controller
 *
 * @author SystemAuth
 * @date 2023-05-22
 */

@RestController(value = "H5CustomerController")
@RequestMapping("/api/customer")
@Api(tags = "客服电话接口")
public class CustomerController extends BaseController {

    @Autowired
    private CustomerService customerService;

    /**
     * 查询客服电话列表
     */
    @ApiOperation(value = "查看客服电话", response = Customer.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.customerService.selectCustomerList(pageParam);
    }

    /**
     * 修改客服电话
     */
    @ApiOperation(value = "编辑")
    @Log(title = "客服电话", businessType = BusinessType.UPDATE)
    @PutMapping
    public Object edit(@RequestBody Customer customer) {
        return this.customerService.updateCustomer(customer);
    }


}
